package com.dayuanit.dy15.lesson29.demo3;

public class MarCarOrder {

    private String order;

    //线程间通信的媒介对象
    public static final Object obj = new Object();

    //生成一个指令
    public void createOrder(String order) {
        this.order = order;
    }

    //消费一个指令
    public String consume() {
        String orderTmp = order;
        order = null;//
        return orderTmp;
    }

    //返回当前指令
    public String getOrder() {
        return order;
    }

    @Override
    public String toString() {
        return "MarCarOrder{" +
                "order='" + order + '\'' +
                '}';
    }
}
